package qq2564874169.tuaotuao.fx.orm.query;

import java.util.List;

public class PageData<T> {
    private List<T> data;
    private int index;
    private int size;
    private int dataTotal;
    private int pageTotal;

    public int getPageIndex() {
        return index;
    }

    public int getPageSize() {
        return size;
    }

    public int getPageTotal() {
        return pageTotal;
    }

    public int getDataTotal() {
        return dataTotal;
    }

    public List<T> getData() {
        return data;
    }

    public PageData(PageSet pageSet, List<T> data, int count) {
        this.data = data;
        index = pageSet.pageIndex;
        size = pageSet.pageSize;
        dataTotal = count;
        pageTotal = count / size;
        if (count > pageTotal * size) {
            pageTotal++;
        }
    }
}
